﻿using System.Collections.Generic;
using WeBlog.Interfaces;
using WeBlog.Models;
using WeBlog.Repositories;

namespace WeBlog.Models
{
    public class UserProfileModel {
		public User User { get; set; }
        public IEnumerable<Post> Posts { get; private set; }

        public UserProfileModel( IUnitOfWork unitOfWork, int id )
        {
            var repository = new UserRepository(unitOfWork);
            User = repository.Find(id);
            Posts = User.Posts;
        }
	}
}